package march.firstmarch21.march01;

import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableComparable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class CallsBean implements WritableComparable<CallsBean> {
    private String callName;
    private String acceptName;
    private String startTime;
    private String endTime;
    private String time;
    private String callLocation;
    private String acceptLocation;

    public CallsBean() {
    }

    public CallsBean(String callName, String acceptName, String startTime, String endTime, String time, String callLocation, String acceptLocation) {
        this.callName = callName;
        this.acceptName = acceptName;
        this.startTime = startTime;
        this.endTime = endTime;
        this.time = time;
        this.callLocation = callLocation;
        this.acceptLocation = acceptLocation;
    }

    public String getCallName() {
        return callName;
    }

    public void setCallName(String callName) {
        this.callName = callName;
    }

    public String getAcceptName() {
        return acceptName;
    }

    public void setAcceptName(String acceptName) {
        this.acceptName = acceptName;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getCallLocation() {
        return callLocation;
    }

    public void setCallLocation(String callLocation) {
        this.callLocation = callLocation;
    }

    public String getAcceptLocation() {
        return acceptLocation;
    }

    public void setAcceptLocation(String acceptLocation) {
        this.acceptLocation = acceptLocation;
    }

    @Override
    public void write(DataOutput out) throws IOException {
        out.writeUTF(callName);
        out.writeUTF(acceptName);
        out.writeUTF(startTime);
        out.writeUTF(endTime);
        out.writeUTF(time);
        out.writeUTF(callLocation);
        out.writeUTF(acceptLocation);
    }

    @Override
    public void readFields(DataInput in) throws IOException {
        callName = in.readUTF();
        acceptName = in.readUTF();
        startTime = in.readUTF();
        endTime = in.readUTF();
        time = in.readUTF();
        callLocation = in.readUTF();
        acceptLocation = in.readUTF();
    }

    @Override
    public String toString() {
        return callName +","+ acceptName +","+ startTime +","+ endTime +","+ time +","+ callLocation  +","+ acceptLocation;
    }

    @Override
    public int compareTo(CallsBean o) {
        return 0;
    }
}
